function validateItems(form)
{
	var city = document.getElementById("city").value;
	var state = document.getElementById("state").value;
	var businessTitle = document.getElementById("listingTitle").value;
	var phoneNumber = document.getElementById("phone").value;
	var businessLogo = document.getElementById("upload1").value;
	
	var strErrorMsg ="";
	
	if(city.length==0)
	{
		strErrorMsg+="Please Enter the city name.";
		strErrorMsg+="\n";
	}
	if(state.length==0)
	{
		strErrorMsg+="Please Enter the state / province name.";
		strErrorMsg+="\n";
	}
	if(businessTitle.length==0)
	{
		strErrorMsg+="Please Enter the business title.";
		strErrorMsg+="\n";
	}
	if(phoneNumber.length==0)
	{
		strErrorMsg+="Please Enter the business phone number name.";
		strErrorMsg+="\n";
	}
	if(businessLogo.length==0)
	{
		strErrorMsg+="Please Enter the business logo.";
		strErrorMsg+="\n";
	}
	
	if(strErrorMsg.length>0)
	{
		alert(strErrorMsg);
		return false;
	}
}

function validate(form){
	 var errors = [];
	 
	 if ( !checkCheckBox(form.termsConfirm) ) {
	  errors[errors.length] = "You must agree to the terms.";
	 }
	 
	 if (errors.length > 0) {
	  reportErrors(errors);
	  return false;
	 }
	 
	 return true;
	}


function checkCheckBox(cb){
	 return cb.checked;
	}

	function reportErrors(errors){
	 var msg = "There were some problems...\n";
	 var numError;
	 for (var i = 0; i<errors.length; i++) {
	  numError = i + 1;
	  msg += "\n" + numError + ". " + errors[i];
	 }
	 alert(msg);
	}